<!-- #section:basics/sidebar -->
<div id="sidebar" class="sidebar responsive sidebar-fixed">
    <div class="sidebar-shortcuts" id="sidebar-shortcuts">
        <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
            <button class="btn btn-success">
                <i class="ace-icon fa fa-signal"></i>
            </button>
            <button class="btn btn-info">
                <i class="ace-icon fa fa-pencil"></i>
            </button>
            <!-- #section:basics/sidebar.layout.shortcuts -->
            <button class="btn btn-warning">
                <i class="ace-icon fa fa-users"></i>
            </button>
            <button class="btn btn-danger">
                <i class="ace-icon fa fa-cogs"></i>
            </button>
            <!-- /section:basics/sidebar.layout.shortcuts -->
        </div>
        <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
            <span class="btn btn-success"></span>
            <span class="btn btn-info"></span>
            <span class="btn btn-warning"></span>
            <span class="btn btn-danger"></span>
        </div>
    </div><!-- /.sidebar-shortcuts -->

    <ul class="nav nav-list">
        {foreach $side_menu as $l1}
        {if isset($l1['_child'])}
        <li class="">
            <a href="#" class="dropdown-toggle">
                <i class="menu-icon fa {$l1.icon}"></i>
                <span class="menu-text">{$l1.title}</span>
                <b class="arrow fa fa-angle-down"></b>
            </a>
            <b class="arrow"></b>
            <ul class="submenu">
                {foreach $l1['_child'] as $l2}
                {if isset($l2['_child'])}
                <li class="">
                    <a href="#" class="dropdown-toggle">
                        <i class="menu-icon"></i>
                        {$l2.title}
                        <b class="arrow fa fa-angle-down"></b>
                    </a>

                    <b class="arrow"></b>
                    <ul class="submenu">
                        {foreach $l2['_child'] as $l3}
                        <li class="menu_name_{$l3.id}">
                            <a href="#">
                                <i class="menu-icon green fa fa-caret-right"></i>
                                {$l3.title}
                            </a>
                            <b class="arrow"></b>
                        </li>
                        {/foreach}
                    </ul>
                </li>
                {else/}
                <li class="menu_name_{$l2.id}">
                    <a href="{:url($l2['url'])}">
                        <i class="menu-icon fa fa-caret-right"></i>
                        {$l2.title}
                    </a>
                    <b class="arrow"></b>
                </li>
                {/if}
                {/foreach}
            </ul>
        </li>
        {else/}
        <li class="menu_name_{$l1.id}">
            <a href="{:url($l1['url'])}">
                <i class="menu-icon fa {$l1.icon}"></i>
                <span class="menu-text">{$l1.title}</span>
            </a>
            <b class="arrow"></b>
        </li>
        {/if}
        {/foreach}

    </ul><!-- /.nav-list -->

    <!-- #section:basics/sidebar.layout.minimize -->
    <div class="sidebar-toggle sidebar-collapse" data-target="#sidebar" id="sidebar-collapse">
        <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>

    <script type="text/javascript">
        //为左侧菜单添加样式
        var current_menu_id = "{$current_menu.id}";
        var menu = $('.menu_name_'+current_menu_id);
        if($(menu).parent().parent('.nav li').length > 0){
            var p_li = $(menu).parent().parent('.nav li');
            $(p_li[0]).addClass('open');
            if($(p_li).parent().parent('.nav li').length > 0){
                var p_p_li = $(p_li).parent().parent('.nav li');
                $(p_p_li[0]).addClass('open');
            }
        }
        $(menu).addClass('active');
    </script>
</div>